package com.dianjing.dianqun.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.dianjing.dianqun.common.base.CrudMpper;
import com.dianjing.dianqun.model.User;
import com.dianjing.dianqun.model.dto.UserDTO;
import com.dianjing.dianqun.model.dto.UserFlowDTO;

public interface UserMapper extends CrudMpper<User> {
	int deleteByPrimaryKey(Integer userId);

	int insert(User record);

	int insertSelective(User record);

	User selectByPrimaryKey(Integer userId);

	int updateByPrimaryKeySelective(User record);

	int updateByPrimaryKey(User record);

	List<UserDTO> selectFriendUser(Integer id);

	int followUser(User followUser);

	User selectFollowFriendById(@Param("userId")Integer userId, @Param("followId")Integer followId);

	int followUser(@Param("userId")Integer userId, @Param("followId")Integer followId,@Param("isBothFriend")Boolean isBothFriend);

	List<UserDTO> selectFollowMeUser(@Param("userId") Integer id);

	User selectByIdOrPhone(@Param("param")  String param);

	Integer selectFansByUserId(@Param("userId") Integer userId);

	void cancelFollowUser(@Param("userId")Integer userId, @Param("followId")Integer followId);

	List<UserFlowDTO> selectLatelyUserList(@Param("siteId")Integer siteId , @Param("userId")Integer userId ,@Param("type")Integer type);

	List<UserDTO> selectUserByHXGZ(@Param("userId")Integer id);

	int updateFollow(@Param("userId")Integer userId, @Param("followId")Integer followId,@Param("isBothFriend")Boolean isBothFriend);

	User selectUserBySiteId(Integer siteId);

	UserDTO searchUserByKeyword(@Param("keyword")String keyword);

	UserDTO searchUserBySiteId(@Param("siteId")Integer siteId);

	UserDTO convertUser(@Param("userId")Integer userId);


}